/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package poo.bang.cards;

/**
 *
 * @author Capucho
 */
public abstract class CartaGame extends Carta{
    protected int value;
    private Naipe naipeCarta;
	          
    public int getValue(){
        return this.value;
    }
           
    public void setValue(String value) {
        int i;
        i=verificaCarta(value);
        this.value = i;
    }
    
    public void setNaipe(Naipe n) {
        this.naipeCarta = n;
    }

    public Naipe getNaipe() {
        return naipeCarta;
        
    }
   
    public void setNaipe(String v){
        
        switch(v){
            case "copas":
                    this.naipeCarta=Naipe.Copas;
                    break;
            case "espada":
                    this.naipeCarta=Naipe.Espada;
                    break;
            case "ouro":
                    this.naipeCarta=Naipe.Ouro;
                    break;
            case "paus":
                    this.naipeCarta=Naipe.Paus;
                    break;
        }
        
    }
    
    public int verificaCarta(String s){
	
        switch(s){
            case "a":
                return 1;
      
            case "j": 
                return 11;
           
            case "q":
                return 12;               
            
            case "k":
                return 13;
                
            default:
                return Integer.parseInt(s);
                    
       }
            
    }
    
    public void imprimeCarta(){
        System.out.printf("Nome:");
        System.out.println(super.getName());
        System.out.printf("Valor:");
        System.out.println(this.getValue());     
                
                
    }
}

